import 'package:f_demo_one/components/16_shop_list.dart';
import 'package:flutter/material.dart';

class MyApp16 extends StatelessWidget {
  const MyApp16({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('ListViewSeparated的使用'),
        centerTitle: true,
        backgroundColor: Colors.amber,
      ),
      body: ListView.separated(
        itemBuilder: (BuildContext context, int index) {
          return ShopList();
        },
        separatorBuilder: (BuildContext context, int index) {
          return Container(
            margin: EdgeInsets.only(left: 10, right: 10),
            child: Divider(height: 1, color: Colors.blue),
          );
        },
        itemCount: 20,
      ),
    );
  }
}
